import { DefaultLayout, ParentLayout } from '@/layout'
import type { Route } from '@/layout/components'

export default {
  path: '/common',
  name: 'common',
  component: DefaultLayout,
  redirect: '/common/minAppIndexStyle',
  meta: {
    title: '通用菜单',
    icon: 'menu-common',
    roles: ['通用菜单'],
    sort: 20,
    alwaysShow: true
  },
  children: [
    {
      path: 'minApp',
      name: 'MinApp',
      component: ParentLayout,
      meta: { title: '小程序首页配置', roles: ['小程序首页配置'] },
      children: [
        {
          path: 'minAppBanner',
          name: 'MinAppBanner',
          component: () => import('@/views/common/minAppBanner'),
          meta: {
            title: 'Banner管理',
            roles: ['Banner管理']
          }
        },
        {
          path: 'minAppIcon',
          name: 'MinAppIcon',
          component: () => import('@/views/common/minAppIcon'),
          meta: {
            title: '金刚区配置',
            roles: ['金刚区配置']
          }
        },
        {
          path: 'minAppIndex',
          name: 'MinAppIndex',
          component: () => import('@/views/common/minAppIndex'),
          meta: {
            title: '活动板块配置',
            roles: ['活动板块配置']
          }
        },
        {
          path: 'addOrEditActivity',
          name: 'AddOrEditActivity',
          component: () =>
            import('@/views/common/minAppIndex/addOrEditActivity'),
          meta: {
            title: '活动',
            hidden: true
          }
        }
      ]
    },
    {
      path: 'ruleManage',
      name: 'RuleManage',
      component: () => import('@/views/common/ruleManage'),
      meta: { title: '规则管理', roles: ['规则管理'] }
    },
    {
      path: 'addRule',
      name: 'AddRule',
      component: () => import('@/views/common/ruleManage/addrule'),
      meta: {
        title: '添加规则',
        hidden: true
      }
    },
    {
      path: 'clabelManage',
      name: 'CLabelManage',
      component: () => import('@/views/common/labelManage'),
      meta: { title: '标签管理', roles: ['标签管理'] }
    },
    {
      path: 'systemSetting',
      name: 'SystemSetting',
      component: () => import('@/views/common/systemSetting'),
      meta: { title: '系统设置', roles: ['系统设置'] }
    },
    {
      path: 'messageInfo',
      name: 'MessageInfo',
      component: () => import('@/views/common/messageInfo'),
      meta: { title: '消息通知', roles: ['消息通知'] }
    },
    {
      path: 'ruleAlertManage',
      name: 'RuleAlertManage',
      component: () => import('@/views/common/ruleAlertManage'),
      meta: { title: '规则公告管理', roles: ['规则公告管理'] }
    },
    {
      path: 'jindouCoupon',
      name: 'JindouCoupon',
      component: () => import('@/views/common/jindouCoupon'),
      meta: { title: '金豆抵扣券', roles: ['金豆抵扣券'] }
    },
    {
      path: 'jdCouponCreateLimit',
      name: 'JdCouponCreateLimit',
      component: () =>
        import('@/views/common/jindouCoupon/jdCouponCreateLimit'),
      meta: { title: '抵扣券', hidden: true }
    },
    {
      path: 'rechargeWarm',
      name: 'RechargeWarm',
      component: () => import('@/views/common/rechargeWarm'),
      meta: { title: '预充值预警', roles: ['预充值预警'] }
    }
  ]
} as Route
